#include <iostream>
#include <vector>
#include "CCubes.h"

using namespace std;

void main()
{
	int cubes_num;
	cout << "Enter number of cubes: ";
	cin >> cubes_num;

	vector<cube> cubes(cubes_num);

	for( int i = 0; i < cubes_num; i++ )
	{
		cout << "Enter letters on cube #" << i << ": ";
		cubes[i].Enter();
	}

//	for( int i = 0; i < cubes_num; i++ )
//	{
//		cout << "Cube #" << i << ' ';
//		cubes[i].Print();
//	}

//	cout << endl;

	vector<char> word;
	getchar();
	cout << "Enter word: ";
	int ch;
	while( ( ch = getchar() ) != '\n' )
		word.push_back(ch);

//	for( int i = 0; i < word.size(); i++ )
//		cout << word[i];

	CCubes cb(cubes);
	if( cb.accept( word, 1 ) )
		cout << "YES\n";
	else
		cout << "NO\n";
}
